{include="header"}

<form class="form" action="{$fsc->url()}" method="post">
   <ul class="nav nav-tabs" role="tablist">
      <li class="active"><a href="#home" role="tab" data-toggle="tab">General</a></li>
      <li><a href="#beta" role="tab" data-toggle="tab">Cálculo de precios</a></li>
   </ul>
   
   <div class="tab-content">
      <div class="tab-pane active" id="home">
         <div class="container-fluid" style="margin-top: 10px;">
            <div class="row">
               <div class="col-lg-3 col-md-3 col-sm-4">
                  <div class="form-group">
                     Zona horaria:
                     <select class="form-control" name="zona_horaria">
                     {loop="$fsc->get_timezone_list()"}
                        {if condition="isset($GLOBALS['config2']['zona_horaria'])"}
                        <option value="{$value['zone']}"{if condition="$value['zone']==$GLOBALS['config2']['zona_horaria']"} selected="selected"{/if}>
                           {$value['diff_from_GMT']} - {$value['zone']}
                        </option>
                        {else}
                        <option value="{$value['zone']}">{$value['diff_from_GMT']} - {$value['zone']}</option>
                        {/if}
                     {/loop}
                     </select>
                  </div>
               </div>
               <div class="col-lg-3 col-md-3 col-sm-4">
                  <div class="form-group">
                      Nº de la primera factura de venta:
                     <input class="form-control" type="number" name="nfactura_cli" value="{$GLOBALS['config2']['nfactura_cli']}"/>
                  </div>
               </div>
            </div>
            
            <div class="row">
               <div class="col-lg-12">
                  <h2>Traducciones:</h2>
               </div>
            </div>
            <div class="row">
               {loop="$fsc->claves()"}
               <div class="col-lg-2 col-md-2 col-sm-3">
                  <div class="form-group">
                     <span class="text-capitalize">{$value['nombre']}:</span>
                     <input class="form-control" type="text" name="{$value['nombre']}" value="{$value['valor']}"/>
                  </div>
               </div>
               {/loop}      
            </div>
         </div>
      </div>
      <div class="tab-pane" id="beta">
         <div class="container-fluid" style="margin-top: 10px;">
            <div class="row">
               <div class="col-lg-3">
                  <div class="form-group">
                     Aplicar el margen:
                     <select name="margin_method" class="form-control">
                        <option value="PVP"{if condition="$GLOBALS['config2']['margin_method']=='PVP'"} selected='selected'{/if}>sobre el precio de venta</option>
                        <option value="CST"{if condition="$GLOBALS['config2']['margin_method']=='CST'"} selected='selected'{/if}>sobre el precio de coste</option>
                     </select>
                  </div>
               </div>
               <div class="col-lg-3">
                  <div class="form-group">
                     Precio de coste:
                     <select name="cost_is_average" class="form-control">
                        <option value="1"{if condition="$GLOBALS['config2']['cost_is_average']=='1'"} selected='selected'{/if}>Calculado</option>
                        <option value="0"{if condition="$GLOBALS['config2']['cost_is_average']=='0'"} selected='selected'{/if}>Editable</option>
                     </select>
                  </div>
               </div>
            </div>
         </div>
      </div>
   </div>

   <div class="container-fluid" style="margin-top: 20px;">
      <div class="row">
         <div class="col-lg-6 col-md-6 col-sm-6">
            <button class="btn btn-sm btn-danger" type="button" onclick="window.location.href='{$fsc->url()}&reset=TRUE'">
               <span class="glyphicon glyphicon-trash"></span>
               &nbsp; Reiniciar
            </button>
         </div>
         <div class="col-lg-6 col-md-6 col-sm-6 text-right">
            <button class="btn btn-sm btn-primary" type="submit" onclick="this.disabled=true;this.form.submit();">
               <span class="glyphicon glyphicon-floppy-disk"></span>
               &nbsp; Guardar
            </button>
         </div>
      </div>
   </div>
</form>

{include="footer"}